from enum import Enum
import os
from pathlib import Path


class FilePath(Enum):
    FILE = Path(__file__).resolve().parent
    # 项目根目录
    PROJECT_ROOT_PATH = os.path.dirname(FILE)
    # 资源文件目录
    RESOURCE_PATH = os.path.join(PROJECT_ROOT_PATH, "resource")
    # YAML 开发环境文件目录
    YAML_PATH_DEV = os.path.join(RESOURCE_PATH, "application-dev.yaml")
    # YAML 生产环境文件目录
    YAML_PATH_PRODUCT = os.path.join(RESOURCE_PATH, "application-product.yaml")
    # 日志文件目录
    LOGS_PATH = os.path.join(RESOURCE_PATH, "logs/")


class DeviceTypeMap(Enum):
    # 主盒子
    MASTER = "FFF"
    # 辅盒子A
    SLAVE = "FFE"
    # 辅盒子B
    GAS = "FFD"
    # 不知道是啥，可能是开关啥的
    SWITCHER = "FFC"
    # 空气净化器
    AIRPURIFIER = "100"
    # 加湿器
    HUMIDIFIER = "101"
    # 加热器
    HEATER = "102"
    # 断路器
    UNLINE = "103"
    # 无卡燃气表
    NOCARDGAS = "104"
    # 智能门锁
    DOORLOCK = "105"


class ProcessedStatus(Enum):
    # 已处理
    PROCESSED = 1
    # 处理中
    PROCESSING = 2
    # 未处理
    NOT_PROCESSED = 3
    # 已关闭
    CLOSED = 4


if __name__ == '__main__':
    print(FilePath.YAML_PATH_PRODUCT.value)
